constructfandomcom_ko-20200215-history
사용자:Softblow/작업장/효과
http://sourceforge.net/apps/mediawiki/construct/index.php?title=Effects 컨스트럭트에서의 효과 (Effects) 는 픽셀 셰이더(pixel shaders)를 사용한다. 이는 PS 0.0, 즉 효과를 사용하는데 하드웨어 대신 다른 요소를 사용하는 효과들을 제외하고는 픽셀 셰이더를 지원하는 그래픽 카드가 필요하다는 것을 의미한다. 효과를 만들고 싶고 그 자세한 내용을 알고 싶다면, 픽셀 셰이더를 보면 된다. 효과 사용하기 컨스트럭트에서 효과를 넣는 것은 무척이나 간단하다. 효과를 넣을 객체(Objects) 나 층(Layers)을 선택한 다음에 속성 막대의 효과(Effects) 탭에서 속성 추가(Add Effect) 버튼을 누르면 된다. 한번 효과를 넣었다면, 넣은 효과와 관련된 값을 설정하는 부분이 속성 막대에 나와있을 것이다. frame|더하기(Additive) 효과의 속성 The category title - Additive Plus (PS 2.0) - has the name of the effect and the pixel shader version it requires. The Name field allows you to give the effect a custom name. Disable when is for shader versioning. Remove effect will remove the effect from the object type (when you add or remove an effect, it affects all instances). Finally, the properties in between, such as Intensity for Additive Plus, are properties specific to the effect. Pixel shaders in Application Properties These properties contain some useful controls for Pixel shaders. Shader version is your local system's supported version. Run without PS (ie. Run without Pixel Shaders), if ticked, allows your program to run on systems that don't support the game's shaders. For example, if your game used Warp (a PS 2.0 effect), by default the user will receive an error message if their computer does not support at least PS 2.0. By enabling Run without PS, the game will run without any error messages, but with all unsupported effects disabled. left|thumb|400px|The error message when a user's computer does not support a pixel shader and Run without PS is disabled Simulate shader is a useful option to see what your game will look like on a computer with a lower pixel shader version than you have. When this option is changed, you will be reminded whenever you preview that you are simulating a lower pixel shader version than you have, so you don't accidentally leave it. You can't simulate a higher pixel shader than you have - there is no substitute for the special hardware you need for pixel shaders. Note you will also receive the above error message when Run without PS is disabled and you are simulating an unsupported shader: Construct faithfully reproduces the runtime behaviour on a computer when simulating a shader. The 'Disable when:' effect property This property allows you to conditionally disable the effect depending on the user's supported pixel shader version. If you have a Warp (PS 2.0) effect set to disable when PS 2.0 unavailable, that simply means if you run it on PS 1.4 or lower, it gets disabled and renders normally. You can set up two effects with opposite disabling to allow your game to support two pixel shader versions. To the left is an example graphic: left|thumb|200px right|thumb|300px This explosion is drawn on a black background and doesn't look very realistic like that. There are two effects that solve this: Additive (PS 0.0) or Screen (PS 2.0), Screen being a higher quality blend. This is shown on the right. Although it is somewhat a matter of opinion, the Screen has a smoother blend, and Additive is harsher, and also quickly fills out white if overlapping another Additive blended object. Choosing to use Screen poses a problem for users who don't have PS 2.0 - disabling the effect leaving black borders, it's ugly. It is possible to set up 'Disable when:' to use the PS 0.0 Additive blend where PS 2.0 is not supported. By adding add a Screen blend and setting it to Disable when PS 2.0 unavailable, Construct won't attempt to run Screen on a computer which doesn't support it. Therefore by also adding an Additive (PS 0.0) effect, and setting it to Disable when PS 2.0 available won't intefere on a computer which supports Screen, but it will enable when Screen can't run. The end result is rather nice: all the explosions use Additive blending where PS 2.0 is not supported, and they all use Screen blending when PS 2.0 is present. This is called a fallback effect because when one effect is not supported, it falls back to using a simpler effect. Simulate shader comes in handy for testing. Setting simulate to PS 0.0 and previewing, Construct simulates PS 2.0 being unavailable, and all the explosions switch to additive blends. Turning off shader simulation when you have PS 2.0 will mean they all use Screen blends as normal. For this reason, it is best to have a computer with a high pixel shader version for development, so you can test your setup for all versions. Destroy when' in Common properties right|thumb|200px|If a user does not support PS 1.4, you can disable the effect, leaving the black and white circle gradient object there, but it looks rather ugly. It might be better to simply destroy the object left|thumb|300px Sometimes you do not want an object to display at all if its effect is not supported. An example case of this is combining two graphics, one with an effect, to make a glass orb effect: 1. Start with a black and white circle gradient and a semitransparent glass orb graphic. 2. Add 'Magnify' (a PS 1.4 effect) to the circle gradient - notice it distorts background 3. Move both objects to the same position and the glass orb appears to refract the background. All you need to do is set Destroy when: in the circle gradient's Common properties to destroy when Pixel shader 1.4 unavailable. If you now simulate shader 0.0, you will simply see the glass graphic on its own. This is an acceptable substitute for the eye candy Pixel shader 1.4 allows us with Magnify. The PS_Version expression Events can be used to set up other alternatives depending on a user's pixel shader version. By using the System object's Compare values expression, you can compare PS_Version and check if it is less than 2, for example. Compare these ghost graphics. The Exclusion effect uses PS 2.0, but as a substitute where PS 2.0 is unavailable, suppose we want a semitransparent effect instead. image:ghostfx.png Opacity cannot be conditionally enabled, becuase it is a property, not an effect. Also, opacity effects will run everywhere, because they don't use pixel shaders (consider them a PS 0.0 effect). Setting Exclusion to disable when PS 2.0 unavailable, and use the following event: image:ghostevent.png If a user's PC doesn't support PS 2.0, the exclusion effect is disabled and replaced with 50% opacity, which at least looks somewhat ghostly. Again, you can test this with Simulate Shader in application properties: PS_Version returns the shader version you are simulating. Summary You can use Disable when settings on effects to set up effect fallbacks, or simply to turn off effects where they are not supported. Destroy when settings can simply get rid of entire objects if they are unsupported and simply for eye candy. Events using the PS_Version expression can set up custom behaviour for different pixel shader versions. The Run without PS option can require your game to have a certain pixel shader version to run at all. Finally, the Simulate Shader property is important for testing all these options, and verifying how your game appears on computers with a lower pixel shader version, or to see if it will even run at all (because of the Run without PS option). These systems are designed to allow all your users a good visual experience regardless of their pixel shader version, also allowing you to lower your minimum requirements - so it is worth being familiar with these controls. It is important for your game to run and look good on computers with any pixel shader version!